Let $a,b,c,d,e,f,g$ and $h$ be distinct elements in the set \[
\{-7,-5,-3,-2,2,4,6,13\}.
\]What is the minimum possible value of \[
(a+b+c+d)^{2} + (e+f+g+h)^{2}?
\]
Explanation: Note that the sum of the elements in the set is 8. Let $x=a+b+c+d$, so $e+f+g+h=8-x$. Then

\begin{align*}
(a+b+c+d)^{2} &+ (e+f+g+h)^{2} = x^{2} + (8-x)^{2}\\
&= 2x^{2} - 16x + 64
= 2(x-4)^{2} + 32
\geq 32.
\end{align*}The value of 32 can be attained if and only if $x=4$. However, it may be assumed without loss of generality that $a=13$, and no choice of $b,c$, and $d$ gives a total of 4 for $x$. Thus $(x - 4)^2 \ge 1$, and \[
(a+b+c+d)^2 + (e+f+g+h)^2 = 2(x-4)^2 + 32 \geq \boxed{34}.
\]A total of 34 can be attained by letting $a,b,c$, and $d$ be distinct elements in the set $\{-7,-5,2,13\}$.